package com.msmall.community.team.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.msmall.base.model.BaseObject;

@Entity
@Table(name="team_property")
public class TeamProperty extends BaseObject{

	private static final long serialVersionUID = 1533840880761367889L;
	
	public static final String KEY_VISIT = "team_visit"; // 此组空间是否能被访问 1所有人(组员/陌生人)都可以查看；2只有组员可以查看到
//	public static final String KEY_MEMBER_VIEW = "team_member_view"; // 此组成员列表是否被访问 1所以人(组员/陌生人)都可以查看；2只有组员可以查看到
//	public static final String KEY_TOPIC_VIEW = "team_topic_view"; // 此组话题列表是否被访问  1所以人(组员/陌生人)都可以查看；2只有组员可以查看到
//	public static final String KEY_PHOTO_VIEW = "team_photo_view"; //  此组照片列表是否被访问 1所以人(组员/陌生人)都可以查看；2只有组员可以查看到
	public static final String KEY_SHARED_TEAM = "team_shared_team";//共享组，组ID以,分割
	public static final String KEY_AUTHRIZED_USER = "team_authrized_user";//指定的用户，用户ID以,分割
	public static final String KEY_APPLY_AUDIT = "team_apply_audit";//入组申请是否需要组长/副组长审核;默认不审核
	
	public static final String VALUE_DEFAULT_ALL = "1"; //所有人(组员/陌生人)具有权限
	public static final String VALUE_DEFAULT_ONLY_MEMBER = "2"; //只有组员具有权限
	public static final String VALUE_DEFAULT_TEAM = "3";//共享组具有权限(包括VALUE_DEFAULT_ONLY_MEMBER)
	public static final String VALUE_DEFAULT_AUTHRIZED_USER = "4";//指定的用户具有权限
	public static final String VALUE_DEFAULT_NONE = "5";//任何人不具有权限
	public static final String VALUE_APPLY_AUDIT_YES = "1"; //入组申请需要审核
	public static final String VALUE_APPLY_AUDIT_NO = "2"; //入组申请不需要审核
	
	@Id
	@Column(name="propertyid")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long propertyid;
	
	@Column(name="property_key")
	private String propertyKey;
	
	@Column(name="property_value")
	private String propertyValue;
	
	@ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER)
	@JoinColumn(name="teamid")
	private Team team;

	public Long getPropertyid() {
		return propertyid;
	}

	public void setPropertyid(Long propertyid) {
		this.propertyid = propertyid;
	}

	public String getPropertyKey() {
		return propertyKey;
	}

	public void setPropertyKey(String propertyKey) {
		this.propertyKey = propertyKey;
	}

	public String getPropertyValue() {
		return propertyValue;
	}

	public void setPropertyValue(String propertyValue) {
		this.propertyValue = propertyValue;
	}

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}
